package com.yanqu.road.logic.activity.foxcard.game.effect;

import com.yanqu.road.entity.activity.foxcard.FoxBaseCard;
import com.yanqu.road.entity.activity.foxcard.FoxHandCard;
import com.yanqu.road.logic.activity.foxcard.game.FoxCardCombo;
import com.yanqu.road.logic.activity.foxcard.game.FoxCardGameLogic;
import com.yanqu.road.logic.activity.foxcard.game.eFoxCardTriggerType;

import java.util.Collections;
import java.util.List;

/**
 * 打出对应的牌型时，可以触发加成效果
 * 牌型|加筹码|乘筹码|加倍率|乘赔率|金币
 */
public class FoxCardEffect1 extends FoxCardEffectBase {
    @Override
    protected void effectHandle(FoxCardGameLogic gameLogic, FoxHandCard handCard) {
        if (triggerType != eFoxCardTriggerType.AFTER_SCORE) {
            return;
        }

        FoxCardCombo nowCombo = gameLogic.getNowCombo();
        if (nowCombo == null) {
            return;
        }
        Integer checkComboType = Integer.valueOf(effectConfig.getParamsList().get(0));
        if (checkComboType != 0 && nowCombo.getComboId() != checkComboType) {
            return;
        }
        List<FoxBaseCard> foxEffectCards = Collections.singletonList(effectCard);
        gameLogic.addBaseScore(Integer.valueOf(effectConfig.getParamsList().get(1)), foxEffectCards, null); //加基础筹码
        gameLogic.addBaseScoreMulti(Integer.valueOf(effectConfig.getParamsList().get(2)), foxEffectCards, null); //当前基础筹码乘算
        gameLogic.addBaseMulti(Integer.valueOf(effectConfig.getParamsList().get(3)), foxEffectCards, null); //加基础倍率
        gameLogic.addBaseMultiMulti(Integer.valueOf(effectConfig.getParamsList().get(4)), foxEffectCards, null); //当前基础倍率乘算
        gameLogic.goldChange(Integer.valueOf(effectConfig.getParamsList().get(5)), foxEffectCards, null, triggerType); //加金币
    }
}
